<?php
if($this->row->getId()) {
	echo $this->form()->hidden('manualKeyNameCheck', '1');
	echo $this->form()->text('name', $this->row->getName(), array('size'=>'30', 'maxlength'=>'50'));
	echo '<code>' . $this->language('Between 2~50 characters and construct by [a-zA-Z0-9_-]') . '.<br/>' . $this->language('As the Frontend URL Address for SEO') . '.</code>';
	return;
}
$manualCheck = array('onclick' => '_manualKeyNameCheck(this)');
$manualInput = array('size'=>'30', 'maxlength'=>'50', 'disabled' => 'disabled');
$manualValue = (string) $this->language('AUTO CREATE ..');
if($this->manualKeyNameCheck) {
	$manualCheck = array_merge($manualCheck, array('checked' => 'checked'));
	unset($manualInput['disabled']);
	$manualValue = $this->row->getName();
}
echo '<fieldset style="width:auto;float:left;margin:5px;padding:1px 6px;">';
echo '<legend style="margin:0 5px;">&nbsp;&nbsp;';
echo $this->form()->checkbox('manualKeyNameCheck', '1', $manualCheck);
echo '<label for="manualKeyNameCheck" style="margin:0 5px 0 0;padding:2px 0 0 3px;font-weight:bold;"> ' . $this->language('CHANGE MANUALLY') . '</label></legend>';
echo '<p style="padding-top:6px;">';
echo $this->form()->text('name', $manualValue, $manualInput);
echo '<code>' . $this->language('Between 2~50 characters and constructed by [a-zA-Z0-9_-]') . '.<br/>' . $this->language('As the Frontend URL Address for SEO') . '.</code>';
echo '</p>';
echo '</fieldset>';
?>
<?php $this->headScript()->captureStart();?>
function _manualKeyNameCheck(c) {
	if(c.checked) {
		$('input#name').attr('disabled', 'disabled');
		$('input#name').val('<?php echo $this->language('AUTO CREATE ..');?>');
	} else {
		$('input#name').removeAttr('disabled');
		$('input#name').val('');
		$('input#name').focus();
	}
}
<?php $this->headScript()->captureEnd();?>